package com.jdn;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * User: arsentyev
 * Date: 22.08.12
 */
public class Container {
    private String className;
    private String packageName = "";
    private String syntax = "";
    private String since = "1.6";
    private String summary = "";
    private Hierarchy hierarchy;

    private final List<String> authors = new ArrayList<String>();

    private final List<Wrapper> constructors = new ArrayList<Wrapper>();
    private final List<Wrapper> methods = new ArrayList<Wrapper>();
    private final List<FieldWrapper> fields = new ArrayList<FieldWrapper>();

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public String getSince() {
        return since;
    }

    public void setSince(String since) {
        this.since = since;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public Hierarchy getHierarchy() {
        return hierarchy;
    }

    public void setHierarchy(Hierarchy hierarchy) {
        this.hierarchy = hierarchy;
    }

    public List<String> getAuthors() {
        return authors;
    }

    public List<Wrapper> getConstructors() {
        return constructors;
    }

    public List<Wrapper> getMethods() {
        return methods;
    }

    public List<FieldWrapper> getFields() {
        return fields;
    }

    public void addAuthor(String author) {
        authors.add(author);
    }

    public void addConstructor(Wrapper constructor) {
        constructors.add(constructor);
    }

    public void addMethod(Wrapper method) {
        methods.add(method);
    }

    public void addField(FieldWrapper field) {
        fields.add(field);
    }

    public String getSyntax() {
        return syntax;
    }

    public void setSyntax(String syntax) {
        this.syntax = syntax;
    }

    public String getPathName() {
        return packageName.replace(".", File.separator) + File.separator + className;
    }

    //------------------------------------------------------------------------//

    public static class Hierarchy {
        String className;
        Hierarchy next;

        public Hierarchy(String className, Hierarchy next) {
            this.className = className;
            this.next = next;
        }
    }

    public static class Wrapper {
        String name;
        String desc;
        String mod;

        public Wrapper(String name, String desc, String mod) {
            this.name = name;
            this.desc = desc;
            this.mod = mod;
        }
    }

    public static class FieldWrapper {
        String name;
        String desc;
        String mod;
        String type;

        public FieldWrapper(String name, String desc, String mod, String type) {
            this.name = name;
            this.desc = desc;
            this.mod = mod;
            this.type = type;
        }
    }
}